#!/bin/bash
j="jdbc:oracle:thin:@192.168.3.245:1521/ORCL"
u="s1104"
p="123456"
l="ORA_HK"
l2="ORA_DYW"
db_n="ods1104"
echo "------------------开始编写sqoop语句，进行还款信息表的数据全量抽取-------------"
sqoop import \
--hive-import \
--connect ${j} \
--username ${u} \
--password ${p} \
--table ${l} \
--hive-database ${db_n} \
--fields-terminated-by ',' -m 1
echo $?
c=hive -e "set hive.exec.mode.local.auto=true;select count(*) from ${db_n}.${l};"
echo "----------------还款表数据已抽取完成,一共抽取了${c}条数据--------"
echo "------------------开始编写sqoop语句，进行抵押物信息表的数据全量抽取-------------"
sqoop import \
--hive-import \
--connect ${j} \
--username ${u} \
--password ${p} \
--table ${l2} \
--hive-database ${db_n} \
--fields-terminated-by ',' -m 1
echo $?
c=hive -e "set hive.exec.mode.local.auto=true;select count(*) from ${db_n}.${l2};"
echo "----------------抵押物表数据已抽取完成,一共抽取了${c}条数据--------"